<?php

namespace common\models\patient;

use Yii;

/**
 * This is the model class for table "{{%patient_month_revisiting_record}}".
 *
 * @property int $id
 * @property int $project_id 项目id
 * @property int $clinic_id 诊室id
 * @property string $patient_card_id 患者诊疗号
 * @property int $month 到诊月份
 * @property int $status 状态【1：正常，0：无效，-1：删除】
 * @property int $created_at 新增时间
 * @property int $updated_at 更新时间
 */
class MonthRevisitingRecord extends \common\models\BaseModel
{

    const STATUS_DELETE = -1;// 删除
    const STATUS_INVALID = 0;// 失效
    const STATUS_ENABLE = 1;// 正常

    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return '{{%patient_month_revisiting_record}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['project_id', 'clinic_id', 'month', 'status', 'created_at', 'updated_at'], 'integer'],
            [['patient_card_id'], 'string', 'max' => 50],
            [['project_id', 'clinic_id', 'patient_card_id', 'month'], 'unique', 'targetAttribute' => ['project_id', 'clinic_id', 'patient_card_id', 'month']],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'project_id' => '项目id',
            'clinic_id' => '诊室id',
            'patient_card_id' => '患者诊疗号',
            'month' => '到诊月份',
            'status' => '状态【1：正常，0：无效，-1：删除】',
            'created_at' => '新增时间',
            'updated_at' => '更新时间',
        ];
    }
}
